package mn.idax.exchange.otc.util.function;


import io.swagger.models.auth.In;
import mn.idax.exchange.otc.util.DateUtils;
import org.apache.poi.ss.formula.functions.T;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @Auther: dison
 * @Date: 2018/9/6 09:39
 * @Description:
 */
public class TransactionRetry {

    public static void failRetry(Consumer consumer){
        System.out.println("=================>>1" );
        consumer.accept(null);
        System.out.println("=================>>2" );
    }

    public static <T>T failRetry1(Supplier<T> supplier){
        return supplier.get();
    }

    public static Integer p(){
        return 1;
    }
    public static void main(String[] args) throws Exception{
        int i = TransactionRetry.failRetry1(() -> p());
//        System.out.println(i);
        //------------------------//
        TransactionRetry.failRetry((s) -> {
            System.out.println("==================>.3");
        });
    }
}
